FROM ubuntu:18.04

COPY sources.list /etc/apt/sources.list

WORKDIR /opt

RUN apt-get update && apt-get install -y wget \
&& wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.1.4/deb/x86_64/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz \
&& wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.1.4/deb/x86_64/LibreOffice_7.1.4_Linux_x86-64_deb_langpack_zh-CN.tar.gz \
&& tar xf LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz \
&& tar xf LibreOffice_7.1.4_Linux_x86-64_deb_langpack_zh-CN.tar.gz \
&& dpkg -i LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS/*.deb \
&& dpkg -i LibreOffice_7.1.4.2_Linux_x86-64_deb_langpack_zh-CN/DEBS/*.deb \
&& apt-get install -y libxinerama1 libdbus-1.3 libgtk-3-0 libx11-xcb1 libsm6 \
&& apt-get install -y openjdk-8-jre \
&& rm -rf /opt/LibreOffice_* \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
ENV PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin